<?php
namespace PsiFramework\Classes\Util\Parameters\Object\Operations;

import("Classes.Util.Parameters.Object.Operation");
import("Classes.Util.Parameters.Object.Operations.Elements.OperationObject");
import("Classes.Util.Parameters.Object.Operations.Elements.OperationSimpleClause");
import("Classes.Util.Parameters.Object.Operations.Elements.OperationColumn");

use \PsiFramework\Classes\Util\Parameters\Object\Operation;
use \PsiFramework\Classes\Util\Parameters\Object\Operations\Elements\OperationSimpleClause;

/**
 * PsiFramework
 * Php Simple Framework
 *
 * @author Rémi San
 * @version beta
 */

/**
 * The Trigger class is the class to manage object parameters insert operations
 *
 * @package Util.Parameters.Object
 */
class InsertOperation extends Operation
{

    protected /*OperationSimpleClause[]*/ $_clauses ;

    public function __construct(
        /*string*/ $type=null,
        /*OperationObject[]*/ $objects=null,
        /*OperationSimpleClause[]*/ $clauses=array()
    )
    {
        if (is_null($type)) {
            $type = "INSERT" ;
        }
        parent::__construct($type, $objects);
        $this->_clauses = $clauses ;
    }

    public function getClauses()
    {
        return $this->_clauses ;
    }

    public function setClauses(/*OperationSimpleClause[]*/ $clauses)
    {
        $this->_clauses = $clauses ;
    }

    public function addClause(OperationSimpleClause $clause)
    {
        if (is_null($this->_clauses)) {
            $this->_clauses = array();
        }
        $this->_clauses[] = $clause ;
    }

}
